﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="QnA.aspx.cs" Inherits="EXAM.Admin.Page_Admin.QnA" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .multipleRowsColumns .rcbItem, .multipleRowsColumns .rcbHovered
        {
            float: left;
            margin: 0 1px;
            min-height: 13px;
            overflow: hidden;
            padding: 2px 19px 2px 6px;
            width: 125px;
        }
        .rcbHeader ul, .rcbFooter ul, .rcbItem ul, .rcbHovered ul, .rcbDisabled ul
        {
            width: 100%;
            display: inline-block;
            margin: 0;
            padding: 0;
            list-style-type: none;
        }
        .col1, .col2, .col3, .col4
        {
            float: left;
            width: 110px;
            margin: 0;
            padding: 0 5px 0 0;
            line-height: 14px;
        }
        label, .selection-result
        {
            font: 13px 'Segoe UI' , Arial, sans-serif;
            color: #4888a2;
        }
        label
        {
            padding: 0 10px 0 0;
        }
        .button
        {
            vertical-align: middle;
            margin-left: 10px;
        }
        .selection-result
        {
            padding: 10px 0 10px 0;
            display: block;
        }
        div.bigModuleBottom
        {
            padding-top: 25px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlacebody" runat="server">
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="cboType">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="cboParent" />
                    <telerik:AjaxUpdatedControl ControlID="dgvList" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td align="center" class="formTitle">
                Question And Answer
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
                <asp:Label ID="lbErr" runat="server" ForeColor="Red"></asp:Label>
                <br />
                <br />
                <table>
                    <tr>
                        <td>
                            Question
                        </td>
                        <td>
                            <telerik:RadEditor ID="txtQuest" runat="server">
                                <Content>
                                
                                </Content>
                                <ImageManager ViewPaths="~/Upload" />
                                <TemplateManager ViewPaths="~/Upload/Templates" SearchPatterns="*.html|*.htm" />
                                <DocumentManager ViewPaths="~/Upload/Documents" SearchPatterns="*.*" />
                                <FlashManager ViewPaths="~/Upload/Flashs" SearchPatterns="*.swf" />
                            </telerik:RadEditor>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Answer
                        </td>
                        <td>
                            <telerik:RadEditor ID="txtAnswer" runat="server">
                                <Content>
                                
                                </Content>
                                <ImageManager ViewPaths="~/Upload" />
                                <TemplateManager ViewPaths="~/Upload/Templates" SearchPatterns="*.html|*.htm" />
                                <DocumentManager ViewPaths="~/Upload/Documents" SearchPatterns="*.*" />
                                <FlashManager ViewPaths="~/Upload/Flashs" SearchPatterns="*.swf" />
                            </telerik:RadEditor>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            User
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboUser" runat="server" Width="400px" Height="190px" MarkFirstMatch="true"
                                OnItemDataBound="cboUser_ItemDataBound">
                                <HeaderTemplate>
                                    <ul>
                                        <li class="col1">Name</li>
                                        <li class="col2">Pos.</li>
                                        <li class="col3">Dep.</li>
                                        <li class="col4">Pro.</li>
                                    </ul>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <ul>
                                        <li class="col1">
                                            <%# DataBinder.Eval(Container.DataItem, "Lastname") %>
                                            <%# DataBinder.Eval(Container.DataItem, "Firstname") %></li>
                                        <li class="col2">
                                            <%# DataBinder.Eval(Container.DataItem, "ANAL_U0") %></li>
                                        <li class="col3">
                                            <%# DataBinder.Eval(Container.DataItem, "ANAL_U1") %></li>
                                        <li class="col4">
                                            <%# DataBinder.Eval(Container.DataItem, "ANAL_U2") %></li>
                                    </ul>
                                </ItemTemplate>
                                <FooterTemplate>
                                    A total of
                                    <asp:Literal runat="server" ID="RadComboItemsCount" />
                                    items
                                </FooterTemplate>
                            </telerik:RadComboBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Create Time
                        </td>
                        <td>
                            <telerik:RadDateTimePicker ID="dpCreate" runat="server">
                            </telerik:RadDateTimePicker>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Answer Time
                        </td>
                        <td>
                            <telerik:RadDateTimePicker ID="dpAnswer" runat="server">
                            </telerik:RadDateTimePicker>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Type
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboType" runat="server">
                                <Items>
                                    <telerik:RadComboBoxItem runat="server" Text="Q&amp;A" Value="Q&amp;A" />
                                    <telerik:RadComboBoxItem runat="server" Text="Idea" Value="Idea" />
                                </Items>
                            </telerik:RadComboBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Notes
                        </td>
                        <td>
                            <telerik:RadTextBox ID="txtNotes" runat="server" Width="400px" Height="60px" TextMode="MultiLine">
                            </telerik:RadTextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Status
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboStatus" runat="server">
                                <Items>
                                    <telerik:RadComboBoxItem runat="server" Text="New" Value="N" />
                                    <telerik:RadComboBoxItem runat="server" Text="Answered" Value="Y" />
                                    <telerik:RadComboBoxItem runat="server" Text="Close" Value="C" />
                                </Items>
                            </telerik:RadComboBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <asp:HiddenField ID="hdIDUser" runat="server" />
                            <asp:HiddenField ID="hdID" runat="server" />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <div style="margin: auto auto 20px auto; width: 350px">
                    <telerik:RadButton ID="btnNew" runat="server" Text="Add New" SplitButtonCssClass=""
                        SplitButtonPosition="Right" OnClick="btnNew_Click" Width="100px">
                    </telerik:RadButton>
                    <telerik:RadButton ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click"
                        Width="100px">
                    </telerik:RadButton>
                    <telerik:RadButton ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click"
                        Width="100px">
                    </telerik:RadButton>
                </div>
                <br />
                <br />
                <div style="width: 100%">
                    <telerik:RadGrid ID="dgvList" runat="server" AutoGenerateColumns="False" GridLines="None"
                        Skin="Office2007" AllowFilteringByColumn="True" AllowMultiRowSelection="True"
                        AllowPaging="True" AllowSorting="True" OnItemCommand="dgvList_ItemCommand" ShowGroupPanel="True"
                        OnNeedDataSource="dgvList_NeedDataSource">
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007">
                        </HeaderContextMenu>
                        <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true"
                            FileName="QnA">
                            <Excel Format="ExcelML" />
                        </ExportSettings>
                        <MasterTableView PageSize="20" DataKeyNames="ID" CommandItemDisplay="Top">
                            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                            <CommandItemSettings ShowRefreshButton="false" ShowExportToExcelButton="true" ShowAddNewRecordButton="false"
                                ExportToExcelText="Export to Excel" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridButtonColumn CommandName="Selected" FilterControlAltText="Filter column column"
                                    Text="Edit" UniqueName="column4">
                                </telerik:GridButtonColumn>
                                <telerik:GridClientSelectColumn FilterControlAltText="Filter column column" UniqueName="column8">
                                </telerik:GridClientSelectColumn>
                                <telerik:GridDateTimeColumn DataField="CreateTime" DataFormatString="{0:MMM dd yy hh:mm:ss}"
                                    FilterControlAltText="Filter column column" HeaderText="Create Time" UniqueName="column3">
                                </telerik:GridDateTimeColumn>
                                <telerik:GridBoundColumn FilterControlAltText="Filter column1 column" HeaderText="Question"
                                    UniqueName="column1" DataField="Question">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Answer" FilterControlAltText="Filter column column"
                                    HeaderText="Answer" UniqueName="column6">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Type" FilterControlAltText="Filter column column"
                                    HeaderText="Type" UniqueName="column5">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="UserInf" 
                                    FilterControlAltText="Filter column column" HeaderText="User Information" 
                                    UniqueName="column">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ToEmail" FilterControlAltText="Filter column column"
                                    HeaderText="To Email" UniqueName="column7">
                                </telerik:GridBoundColumn>
                                <telerik:GridDateTimeColumn DataField="AnswerTime" FilterControlAltText="Filter column9 column"
                                    HeaderText="Answer Time" UniqueName="column9">
                                </telerik:GridDateTimeColumn>
                                <telerik:GridDateTimeColumn DataField="Notes" FilterControlAltText="Filter column10 column"
                                    HeaderText="Notes" UniqueName="column10">
                                </telerik:GridDateTimeColumn>
                                <telerik:GridBoundColumn FilterControlAltText="Filter column2 column" HeaderText="Status"
                                    UniqueName="column2" DataField="Status">
                                </telerik:GridBoundColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings AllowDragToGroup="True">
                            <Selecting AllowRowSelect="True" />
                        </ClientSettings>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                </div>
                <br />
            </td>
        </tr>
    </table>
</asp:Content>
